Skip to content

consumption_dollars: route max_consumption_dollars through fixed_params (pylcm #351 cascade)#11

Open
hmgaudecker wants to merge 1 commit into
feature/categorical-scalarintfrom
feature/runtime-grid-extra-params
Open

consumption_dollars: route max_consumption_dollars through fixed_params (pylcm #351 cascade)#11
hmgaudecker wants to merge 1 commit into
feature/categorical-scalarintfrom
feature/runtime-grid-extra-params

Conversation

@hmgaudecker
Copy link
Copy Markdown
Member

Summary

  • Drops the module-level MAX_CONSUMPTION_DOLLARS = 300_000.0 in baseline/regimes/_common.py; the upper bound of the runtime consumption_dollars grid now enters via fixed_params["max_consumption_dollars"] (per pylcm#351, which adds IrregSpacedGrid(extra_param_names=...)).
  • baseline/regimes/_common.py declares the grid as IrregSpacedGrid(n_points=..., extra_param_names=("max_consumption_dollars",)) so pylcm surfaces the scalar slot in the params template.
  • consumption_dollars_grid.py: _compute_consumption_dollars_points takes the bound as a parameter; inject_consumption_dollars_points reads it from model.fixed_params["max_consumption_dollars"].
  • _benchmark_data/benchmark_params.pkl regenerated so the snapshot carries max_consumption_dollars in fixed_params. Upstream change in aca-data adds the key to environment_constants.
  • CI temporarily pinned to pylcm @feat/runtime-grid-extra-params; revert to @main once pylcm#348/#350 merge.

Stacks on #10 (uses the feature/categorical-scalarint branch as base).

Test plan

  • pixi run -e tests-cpu pytest aca-model -n 4 — 216 passed.
  • Workspace suite — 407 passed.
  • pixi run -e type-checking ty — clean.

🤖 Generated with Claude Code

…ed_params

The upper bound of the runtime consumption_dollars action grid used to
be a module-level constant in `baseline/regimes/_common.py`, with a
TODO to route through `fixed_params` once pylcm could surface
grid-level scalars in the params template. pylcm#348 lands that.

* `baseline/regimes/_common.py`: declare the grid as
  `IrregSpacedGrid(..., extra_param_names=("max_consumption_dollars",))`
  so the template gains a `ScalarFloat` slot per regime alongside
  `points`.
* `consumption_dollars_grid.py`:
  - Drop the module-level `MAX_CONSUMPTION_DOLLARS` constant.
  - `_compute_consumption_dollars_points` takes the bound as a
    parameter.
  - `inject_consumption_dollars_points` reads it from
    `model.fixed_params["max_consumption_dollars"]` (alongside
    `exponent`), then threads it into the gridpoint computation.
* `_benchmark_data/benchmark_params.pkl`: regenerated so
  `fixed_params["max_consumption_dollars"]` is populated from the
  refreshed aca-data env constants.
* CI temporarily pinned to pylcm@feat/runtime-grid-extra-params;
  revert to @main once pylcm#348/#350 merge.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant